<template>
  <nav class="bottom-nav menu glass-card">
    <router-link
      v-for="item in navItems"
      :key="item.name"
      :to="{ name: item.name }"
      class="nav-item"
      :class="{ active: $route.name === item.name }"
    >
      <span class="nav-icon">{{ item.icon }}</span>
      <span class="nav-label">{{ item.label }}</span>
    </router-link>
  </nav>
</template>

<script setup>
const navItems = [
  { name: 'home', label: '首页' },
  { name: 'workout-plan', label: '训练计划' },
  { name: 'exercise-library', label: '动作库' },
  { name: 'nutrition-log', label: '饮食' },
  { name: 'body-stats', label: '身体数据' },
  { name: 'settings', label: '设置' }
];
</script>

<style scoped>
.bottom-nav {
  display: flex;
  flex-grow: 1;
  height: 72px;
  max-width: 370px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 0 1px 0 rgba(52, 46, 173, 0.25), 0 15px 30px 0 rgba(52, 46, 173, 0.1);
  margin: 0 auto;
  width: auto;
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* 桌面端隐藏底部导航 */
@media (min-width: 768px) {
  .bottom-nav {
    max-width: 600px;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.nav-item:focus,
.nav-item:hover {
  outline: none;
}

.nav-item:focus .nav-icon,
.nav-item:hover .nav-icon {
  color: #342ead;
}

.nav-item:focus .nav-label,
.nav-item:hover .nav-label {
    color: #342ead;
  font-size: 32px;
  font-weight: 900;

   color: #342ead;
}

.nav-item:hover {
  background-color: var(--gray-100);
}

.nav-item.active .nav-icon,
.nav-item.active .nav-label {
  color: #342ead;
  font-weight: var(--font-weight-medium);
}

.nav-icon {
  display: block;
  margin-bottom: 4px;
  font-size: 26px;
  color: #a8a9c0;
  transition: 0.25s ease;
}

.nav-label {
  display: block;
  font-size: 20px;
  color: #8a8cb0;
  transition: 0.25s ease;
}
</style>